-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert #1831, the __file__
injection in safe_execfile / safe_execfile_ipy.
#2432
Conversation
I haven't been following this one, but is there an easy way to add a test, so we don't break the same thing next time we try to do that? |
Yes, I think so. I've been working on a better solution in bfroehle/ipy_file_inject. |
Well, some tests are easy to write, like verifying that |
It's possible using pexpect, but probably not worth it. |
It sounds like this issue might be related as well #2356 |
Without objection, I'm planning on merging this tomorrow. I got hit with the Mayavi bug (#2279) yesterday when doing a demo. |
Merging. |
Revert #1831, the `__file__` injection in safe_execfile / safe_execfile_ipy. This reverts commit 2717feb, reversing changes made to ea4f608. Pull request #1831 (fix #1814 set __file__ when running .ipy files) has been the source of a lot of grief: #2279: Setting __file__ to None breaks Mayavi import #2429: Using warnings.warn() results in TypeError In general the patch was inappropriate because it: 1. Fails to properly restore the context, by setting __file__ to None rather than deleting it. 2. Sets __file__ in the wrong dictionary (self.user_ns rather than where[0]).
Revert ipython#1831, the `__file__` injection in safe_execfile / safe_execfile_ipy. This reverts commit 2717feb, reversing changes made to ea4f608. Pull request ipython#1831 (fix ipython#1814 set __file__ when running .ipy files) has been the source of a lot of grief: ipython#2279: Setting __file__ to None breaks Mayavi import ipython#2429: Using warnings.warn() results in TypeError In general the patch was inappropriate because it: 1. Fails to properly restore the context, by setting __file__ to None rather than deleting it. 2. Sets __file__ in the wrong dictionary (self.user_ns rather than where[0]).
This reverts commit 2717feb, reversing changes made to ea4f608.
Pull request #1831 (fix #1814 set
__file__
when running .ipy files) has been the source of a lot of grief:__file__
to None breaks Mayavi import #2279: Setting__file__
toNone
breaks Mayavi importwarnings.warn()
results inTypeError
In general the patch was inappropriate because it:
__file__
to None rather than deleting it.__file__
in the wrong dictionary (self.user_ns
rather thanwhere[0]
).I suggest that we revert pull request #1831 and reopen the original issue (#1814).